package com.hdj.chapter17;

/**
 * @description 责任链模式（Chain of Responsibility）
 * @author hdj
 * @date 2017/12/14.
 */
public class ChainOfResponsibilityTest {
    public static void main(String[] args) {
        MyHandler myHandler1 = new MyHandler("handler1");
        MyHandler myHandler2 = new MyHandler("handler2");
        MyHandler myHandler3 = new MyHandler("handler3");

        myHandler1.setHandler(myHandler2);
        myHandler2.setHandler(myHandler3);
        myHandler1.operator();
    }
}
